package com.github.bridge.client.ca;

import com.dtflys.forest.callback.SuccessWhen;
import com.dtflys.forest.http.ForestRequest;
import com.dtflys.forest.http.ForestResponse;
import org.springframework.http.HttpStatus;

public class CASignSuccessCondition implements SuccessWhen {
    @Override
    public boolean successWhen(ForestRequest forestRequest, ForestResponse forestResponse) {
        // 这里可以判断业务code
        return forestResponse.noException() &&   // 请求过程没有异常
                forestResponse.statusIs(HttpStatus.OK.value());
    }

}
